import request from '@/utils/request'
import downFileRequest from "@/utils/downFileRequest";

// 条件查询采购报告
export function getConditionReport(data){
    return request({
        url: "/report",
        method: "post",
        data: data
    })
}
// 增加采购小组的人员
export function addShoppingUser(data){
    return request({
        url: "/report/addShoppingUser",
        method: "post",
        data: data
    })
}

// 请求获得采购小组成员的信息
export function getAllShoppingUser(data){
    return request({
        url: "/report/" + data,
        method: "get"
    })
}

// 获取所有采购报告
export  function getAllPurchaseReport(data){
    return request({
        url: "/purchase/get/allPurchaseReport/" + data,
        method: "get"
    })
}
// 获得全部盖章后的成交结果通知书
export function getAllResultStamped(data){
    return request({
        url: "/purchase/get/allResultStamped/" + data,
        method: "get"
    })
}

// 下载成交结果通知书盖章文件
export function downResultStamped(data){
    return downFileRequest({
        url: '/purchase/download/resultStamped/' + data,
        method: "get"
    })
}


// 删除 采购小组人员名单
export function deletePurchaseUser(data){
    return request({
        url: "/report/delete/" + data,
        method: "delete"
    })
}

// 下载成果报告
export function downReportFile(data){
    return request({
        url:"/report/downloadFile/" + data,
        method:"get"
    })
}

// 生成成果报告
export function createReportFile(data){
    return request({
        url: "/report/create/report/" + data,
        method: "get"
    })
}

// 下载盖章的结果报告
export function downReportSigned(data){
    return downFileRequest({
        url: `/purchaseReportSigned/download/purchaseReportSigned/${data}`,
        method: "get"
    })
}

// 删除盖章的结果报告
export function deleteReportSigned(data){
    return request({
        url: "/purchaseReportSigned/delete/purchaseReportSigned/" + data,
        method: "delete"
    })
}

// 获取所有盖章后的结果报告文件列表
export function getAllReportSigned(data){
    return request({
        url: "/purchaseReportSigned/get/allPurchaseReportSigned/" + data,
        method: "get"
    })
}
